//西班牙语
let SPN_NAME_ES = new Array();
SPN_NAME_ES[0] = 'PR Claro';
SPN_NAME_ES[1] = 'T-Mobile';
SPN_NAME_ES[2] = 'CLARO PA';
SPN_NAME_ES[3] = 'CLAROCHL';
SPN_NAME_ES[4] = 'CLARODOM';
SPN_NAME_ES[5] = 'CLARO UY';
SPN_NAME_ES[6] = 'CLARO PY';
SPN_NAME_ES[7] = 'CLARO AR';
SPN_NAME_ES[8] = 'Claro';
SPN_NAME_ES[9] = 'CLAROGTM';
SPN_NAME_ES[10] = 'CLAROPER';
SPN_NAME_ES[11] = 'CLARO';
SPN_NAME_ES[12] = 'ClaroSLV';
SPN_NAME_ES[13] = 'ClaroHND';
SPN_NAME_ES[14] = 'ClaroNIC';
SPN_NAME_ES[15] = 'CLARO CR';
SPN_NAME_ES[16] = 'A1';
SPN_NAME_ES[17] = 'NL KPN';
SPN_NAME_ES[18] = 'FL1';
SPN_NAME_ES[19] = 'A1 SI';
SPN_NAME_ES[20] = 'Mtel';
SPN_NAME_ES[21] = 'VIP';
SPN_NAME_ES[22] = 'BASE';
SPN_NAME_ES[23] = 'Vip MKD';
SPN_NAME_ES[24] = 'VELCOM';
SPN_NAME_ES[25] = 'Vip SRB';

/**
 * 解析 SpnName
 * @param {String} MCC 
 * @param {String} MNC 
 * @returns 
 */
export default function getSpnName(MCC, MNC) {

    let SpnName = '';

    let SPN_NAME_ARR = new Array();

    // 根据 key 去语言字典中找对应的数据
    const selectedSpnNames = SPN_NAME_ES;

    // 将字典的数据结构至新数组中
    if (selectedSpnNames) {
        SPN_NAME_ARR = [...selectedSpnNames];
    }

    // MCC MNC字典
    const spnNameDict = {
        '330': {
            '110': SPN_NAME_ARR[0]
        },
        '310': {
            '260': SPN_NAME_ARR[1]
        },
        '714': {
            '03': SPN_NAME_ARR[2],
            '3': SPN_NAME_ARR[2]
        },
        '730': {
            '03': SPN_NAME_ARR[3],
            '3': SPN_NAME_ARR[3]
        },
        '370': {
            '02': SPN_NAME_ARR[4],
            '2': SPN_NAME_ARR[4]
        },
        '748': {
            '10': SPN_NAME_ARR[5]
        },
        '744': {
            '02': SPN_NAME_ARR[6],
            '2': SPN_NAME_ARR[6]
        },
        '722': {
            '310': SPN_NAME_ARR[7]
        },
        '724': {
            '05': SPN_NAME_ARR[8],
            '5': SPN_NAME_ARR[8]
        },
        '732': {
            '101': SPN_NAME_ARR[8]
        },
        '704': {
            '01': SPN_NAME_ARR[9],
            '1': SPN_NAME_ARR[9]
        },
        '716': {
            '10': SPN_NAME_ARR[10]
        },
        '740': {
            '01': SPN_NAME_ARR[11],
            '1': SPN_NAME_ARR[11]
        },
        '706': {
            '01': SPN_NAME_ARR[12],
            '1': SPN_NAME_ARR[12]
        },
        '708': {
            '01': SPN_NAME_ARR[13],
            '1': SPN_NAME_ARR[13]
        },
        '710': {
            '21': SPN_NAME_ARR[14]
        },
        '712': {
            '03': SPN_NAME_ARR[15],
            '3': SPN_NAME_ARR[15]
        },
        '232': {
            '01': SPN_NAME_ARR[16],
            '1': SPN_NAME_ARR[16]
        },
        '204': {
            '08': SPN_NAME_ARR[17],
            '8': SPN_NAME_ARR[17]
        },
        '295': {
            '05': SPN_NAME_ARR[18],
            '5': SPN_NAME_ARR[18]
        },
        '293': {
            '40': SPN_NAME_ARR[19]
        },
        '284': {
            '01': SPN_NAME_ARR[20],
            '1': SPN_NAME_ARR[20]
        },
        '219': {
            '10': SPN_NAME_ARR[21]
        },
        '206': {
            '20': SPN_NAME_ARR[22]
        },
        '294': {
            '03': SPN_NAME_ARR[23],
            '3': SPN_NAME_ARR[23]
        },
        '257': {
            '01': SPN_NAME_ARR[24],
            '1': SPN_NAME_ARR[24]
        },
        '220': {
            '05': SPN_NAME_ARR[25],
            '5': SPN_NAME_ARR[25]
        }
    }

    if (Object.prototype.hasOwnProperty.call(spnNameDict, String(MCC)) && Object.prototype.hasOwnProperty.call(spnNameDict[MCC], String(MNC))) {
        SpnName = spnNameDict[MCC][MNC];
    } else {
        SpnName = ''
    }

    return SpnName;
}
